const ACTIONS = [
  {
    key: 'toLink',
    label: '跳转链接',
    icon: 'icon-link-to',
    action: link => {
      window.open(`https://${link}`);
    }
  },
  {
    key: 'toPage',
    label: '转到页面',
    icon: 'icon-page-list',
    action: page => {
      page.parent.update('previewId', page.id);
    },
  },
  {
    key: 'toAnchor',
    label: '转到锚点',
    icon: 'icon-anchor',
    action: anchor => {
      console.log('转到锚点', anchor);
    },
  },
  {
    key: 'toModal',
    label: '打开弹层',
    icon: 'icon-modal-list',
    action: modal => {
      console.log('打开弹层', modal);
    },
  },
  {
    key: 'toMotion',
    label: '触发动效',
    icon: 'icon-motion',
    action: motion => {
      // console.log('触发动效', motion);
      motion.parent.parent.update('motionToPlay', motion);
    },
  },
];

export const KEYS = ACTIONS.map(item => item.key);

export default ACTIONS;
